home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / gfx / misc / gnuplot-3.7src.lha / gnuplot-3.7src / gnuplot-3.7.lha / gnuplot-3.7 / makefile.mgw < prev    next >
Makefile  |  1998-12-16  |  6KB  |  201 lines

  1. # To compile gnuplot for WinNT and Win95
  2. #
  3. # Changed for use with Cygwin/MinGW32 by HBB
  4. # compile the package with make -f makefile.mgw
  5. # the make utility for MinGW32 can be obtained the MinGW sites
  6. #
  7. # you need Cygwin's windres as of Mingw32-egcs-1.1b
  8. # this makefile was tested with Ming32egcs-1.1b and 
  9. # Microsoft Help Workshop 4.03
  10. #
  11. #
  12.  
  13. # where to place gnuplot.gih helpfile
  14. HELPFILE = wgnuplot.hlp
  15. TOP = .
  16.  
  17. DESTDIR=/Progra~1/Gnuplot3.7
  18.  
  19. # give here the path to your compiler (preferrably MinGW's one)
  20. GCCPATH=/mingw32/bin/
  21.  
  22. # -c  means don't link
  23. # -I  means extra include directory
  24. # -O2 means optimize for speed
  25. # -g  means prepare for debugging
  26. # -mpentium means optimise for Pentium processor
  27. # -mpentiumpro means optimize for Pentium II and Pro procesors
  28.  
  29. CC = $(GCCPATH)gcc
  30. LD = $(GCCPATH)gcc
  31. CFLAGS = -g -O2 -I$(TOP) -D_Windows -DNO_GIH -DHAVE_STRNICMP \
  32.     -DREADLINE -DGP_INLINE=inline -DHAVE_SLEEP -DANSI_C \
  33.     -DHAVE_GETCWD -DNEAR=
  34. LDFLAGS = -g 
  35.  
  36. RM = rm -f
  37. CP = cp -p
  38.  
  39. #
  40. # to compile the .hlp file you need hcw
  41. # either out of Microsoft SDK or
  42. # Microsoft Help Workshop
  43. # the latter can be obtained at www.helpmaster.com/help/devaids.htm
  44. # put the path to hcw here
  45. #
  46. # the followind switches are for HCW 4.03
  47. #
  48. HCWPATH=/Program\ Files/Help\ Workshop/
  49. HCW = $(HCWPATH)hcw
  50. HCWFLAG=
  51.  
  52. # it seems for the moment that we need cygwin's windres
  53. # as the one shipped with mingw32/egcs 1.1b is buggy
  54. # the one with cygwin b20.1 is ok, so give here the complete path
  55. #
  56. RCPATH = /cygnus/cygwin-b20/H-i586-cygwin32/bin
  57. RC  = windres
  58. RCFLAGS=--include-dir /mingw32/include \
  59.     --define __WIN32__ --define __WIN95__ --define MSRC \
  60.     --define __GNUWIN32__
  61. RCOUT=wgplt_res.o
  62. RES2COFF=echo wgplt_res.o
  63.  
  64. #
  65. # you can also use MS SDK's 
  66. #
  67. #MSSDK=f:/mssdk/
  68. #RC=$(MSSDK)/bin/rc
  69. #RCFLAGS=-v -i$(MSSDK)/include -iwin \
  70. #    -dWIN32 -dMSRC
  71. #RCOUT=-fowgnuplot.res
  72. #RES2COFF=res2coff -i wgnuplot.res -o wgplt_res.o
  73.  
  74.  
  75. # see other terminal defines in term.h
  76. TERMFLAGS = -I$(TOP)/term
  77.  
  78. # There shouldn't be anything to be changed below this line
  79. #=======================================================================
  80.  
  81. # macros for makefile.all
  82. O=o
  83. T=term/
  84. D=docs/
  85. L=docs/latex/
  86. M=demo/
  87.  
  88.  
  89. default: wgnuplot.exe $(HELPFILE) wgnuplot.mnu $(M)bf_test.exe
  90.  
  91. # include the 'core makefile template'
  92. include makefile.all
  93.  
  94. OBJS = $(COREOBJS) version.$(O)
  95.  
  96. WINOBJS = winmain.$(O) wgnuplib.$(O) wgraph.$(O) wprinter.$(O) wtext.$(O) wpause.$(O) wmenu.$(O)
  97.  
  98. WINDOWS = makefile.win makefile.nt README.win win/wcommon.h \
  99.     win/wgnuplib.c win/wgnuplib.def win/wgnuplib.h win/wgnuplib.rc \
  100.     win/wgnuplot.def win/wgnuplot.hpj win/wgnuplot.mnu win/wgraph.c \
  101.     win/winmain.c win/wmenu.c win/wpause.c win/wprinter.c \
  102.     win/wresourc.h win/wtext.c win/wtext.h win/geticon.c \
  103.     docs/doc2rtf.c term/win.trm win/grpicon.ico win/texticon.ico
  104.  
  105.  
  106. # default rules
  107. .SUFFIXES: .exe .o .c
  108. .c.o:
  109.     $(CC) -c $(CFLAGS) $*.c
  110.  
  111. LDLIBS = -lkernel32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -ladvapi32
  112.  
  113. wgnuplot.exe: $(OBJS) $(WINOBJS) win/wgnuplot.def wgplt_res.o texticon.ico grpicon.ico
  114.     $(LD) $(LDFLAGS) -mwindows -o $@ $(OBJS) $(WINOBJS) wgplt_res.o $(LDLIBS)
  115.  
  116. # rules
  117.  
  118. wgplt_res.o :  win/wgnuplot.rc win/wgnuplib.rc win/wresourc.h texticon.ico grpicon.ico
  119.     $(RC) $(RCFLAGS) win/wgnuplot.rc $(RCOUT)
  120.     $(RES2COFF)
  121.  
  122. show.o: show.c plot.h setshow.h
  123.     $(CC) -c $(CFLAGS) -DHELPFILE=\"$(HELPFILE)\" -DGNUPLOT_BINDIR=\"$(bindir)\" -c $<
  124.  
  125. term.$(O): term.c term.h plot.h setshow.h bitmap.h $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
  126.     $(CC) -c $(CFLAGS) $(TERMFLAGS) term.c
  127.  
  128. version.$(O): version.c
  129.  
  130. WINDEPS = win/wgnuplib.h win/wcommon.h win/wresourc.h
  131.  
  132. winmain.$(O): win/winmain.c win/wgnuplib.h win/wtext.h plot.h
  133.     $(CC) -c $(CFLAGS) -DHELPFILE=\"$(HELPFILE)\"  win/winmain.c
  134.  
  135. wgnuplib.$(O): win/wgnuplib.c $(WINDEPS)
  136.     $(CC) -c $(CFLAGS) win/wgnuplib.c
  137.  
  138. wmenu.$(O): win/wmenu.c $(WINDEPS)
  139.     $(CC) -c $(CFLAGS) win/wmenu.c
  140.  
  141. wtext.$(O): win/wtext.c $(WINDEPS)
  142.     $(CC) -c $(CFLAGS) win/wtext.c
  143.  
  144. wpause.$(O): win/wpause.c $(WINDEPS)
  145.     $(CC) -c $(CFLAGS) win/wpause.c
  146.  
  147. wprinter.$(O): win/wprinter.c $(WINDEPS)
  148.     $(CC) -c $(CFLAGS) win/wprinter.c
  149.  
  150. wgraph.$(O): win/wgraph.c $(WINDEPS)
  151.     $(CC) -c $(CFLAGS) win/wgraph.c
  152.  
  153. wgnuplot.mnu: win/wgnuplot.mnu
  154.     $(CP) $^ $@
  155.  
  156. # extract icons from wgnuplot.rc
  157. texticon.ico: grpicon.ico
  158.  
  159. grpicon.ico: geticon.exe win/wgnuplot.rc
  160.     ./geticon win/wgnuplot.rc
  161.  
  162. geticon.exe: win/geticon.c
  163.     $(LD) $(LDFLAGS) -o $@ win/geticon.c
  164.  
  165. # convert gnuplot.doc to gnuplot.rtf
  166. $(HELPFILE): doc2rtf.exe docs/gnuplot.doc win/wgnuplot.hpj
  167.     ./doc2rtf docs/gnuplot.doc win/gnuplot.rtf
  168.     $(HCW) \/c \/e win/wgnuplot.hpj
  169.  
  170. doc2rtf.exe: docs/doc2rtf.c docs/termdoc.c docs/xref.c
  171.     $(LD) $(LDFLAGS) -o $@ $(CFLAGS) -I. -Idocs -Iterm $^
  172.  
  173. #make binary demo files
  174. $(M)bf_test.exe : bf_test.c dbinary.$(O) alloc.$(O)
  175.     $(LD) $(LDFLAGS) $(CFLAGS) -U_Windows -o $@ $^
  176.     (cd demo ; ./bf_test.exe )
  177. #    cd ..
  178.  
  179. # _Windows causes wtext.h to define fread() etc
  180. dbinary.$(O): binary.c
  181.     $(CC) -c $(CFLAGS) -U_Windows -o $@ $^
  182.  
  183. # clean up temporary files
  184. clean:
  185.     $(RM) *.$(O) wgnuplot.map wgnuplot.res win/gnuplot.rtf
  186.     $(RM) doc2rtf.exe win/wgnuplib.res wgnuplib.map wgnuplot.lib
  187.     $(RM) demo/bf_test.exe *.ico geticon.exe
  188.  
  189. realclean: veryclean
  190. veryclean: clean
  191.     $(RM) wgnuplot.exe wgnuplot.hlp wgnuplot.mnu wgnuplot.gid
  192.     $(RM) demo/binary[123] demo/fit.log demo/soundfit.par
  193.  
  194. # now move the whole stuff to its destination
  195. install: default
  196.     -mkdir -p $(DESTDIR)
  197.     cp wgnuplot.exe $(DESTDIR)/wgnuplot.exe
  198.     cp win/wgnuplot.mnu $(DESTDIR)/wgnuplot.mnu
  199.     cp wgnuplot.hlp $(DESTDIR)/wgnuplot.hlp
  200.